package com.autumn.xa.a.tuling.jvm;

public class RunTimeSout {
    static {
        System.out.println("*************load TestDynamicLoad************");
    }

    public static void main(String[] args) {
        new A();
        System.out.println("*************load test************");
        B b = null; //B不会加载，除非这里执行 new B()
    }

    static class A {
        static {
            System.out.println("*************load A************");
        }

        public A() {
            System.out.println("*************initial A************");
        }
    }

    static class B {
        static {
            System.out.println("*************load B************");
        }

        public B() {
            System.out.println("*************initial B************");
        }
    }
}
